<?php
	// website main header (logo and navigation)
	include("header.php");

        // classes and objects to be used on this page
	include_once (UCM_PATH . "/UCAddComponent.php");
        include_once (UCM_PATH . "/UCEditComponent.php");
        include_once (UCM_PATH . "/UCDeleteComponent.php");

	// navigation specific to the components page
	include(VIEW_PATH . "/Navigation_Components.php");

?>

<script type="text/javascript" src="script/ComponentScript.js">
</script>

<div id="page-body">
<?php
	$view = $_REQUEST['view'];
	if ($view == "new")
		include_once (VIEW_PATH . '/AddComponentView.php');
	else if ($view == "edit")
		include_once (VIEW_PATH . '/EditComponentView.php');
	else if ($view == "delete")
		include_once (VIEW_PATH . '/DeleteComponentView.php');


	$action = $_REQUEST['action'];
	if ($action == "add")
	{
		$ucAdd = new UCAddComponent();
		$ucAdd->run();
	}
	else if ($action == "edit")
	{
		$ucEdit = new UCEditComponent();
		$ucEdit->run();
	}
	else if ($action == "delete")
	{
		$ucDelete = new UCDeleteComponent();
		$ucDelete->run();
	}
?>
</div>
	
<?php
	include("footer.php");
?>
